package com.party.mobile.web.dto.gift;

import com.party.common.utils.StringUtils;

/**
 * @author： yifeng
 * @description： 礼包相关输入参数
 * @date：Created in  2017/12/14 上午 11:55
 **/
public class GiftInput {
    private String type; // 类型
    private String giftId; // 礼包id
    private String targetId; // 项目id
    private String projectId; // 众筹id
    private Boolean giftFlag; // 众筹报名标识
    private String payment; // 支持者金额
    private Float realPayment; // 支持者金额


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTargetId() {
        return targetId;
    }

    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public Boolean getGiftFlag() {
        return giftFlag;
    }

    public void setGiftFlag(Boolean giftFlag) {
        this.giftFlag = giftFlag;
    }

    public String getPayment() {
        return payment;
    }

    public void setPayment(String payment) {
        this.payment = payment;
    }

    public Float getRealPayment() {
        if (StringUtils.isNotEmpty(payment)) {
            payment = payment.replaceAll("undefined", "").replaceAll("null", "");
            if (StringUtils.isNotEmpty(payment)) {
                return Float.parseFloat(payment);
            }
        }
        return null;
    }

    public void setRealPayment(Float realPayment) {
        this.realPayment = realPayment;
    }

    public String getGiftId() {
        return giftId;
    }

    public void setGiftId(String giftId) {
        this.giftId = giftId;
    }
}
